package main

import (
	"fmt"
	"os/exec"
	"time"
)

func main() {
	//"-an", "|", "grep", "WAIT", "|", "wc", "-l", ">", "wait.log"
	//arg := "-an | grep WAIT | wc -l > wait.log"
	//"netstat", "-an", "|", "grep", "WAIT"
	for {
		res, err := exec.Command("sh", "-c", "netstat -an | grep WAIT | wc -l").Output()
		fmt.Println(fmt.Sprintf("%s", res), err)
		time.Sleep(time.Second * 5)
	}
}
